<!--
 * @Author: Lucifer
 * @Date: 2022-03-13 19:54:12
 * @LastEditTime: 2022-04-03 19:19:24
 * @FilePath: \yiyanyun\app\admin\view\yun.html
-->

{include file='public/header'/}
<main class="lyear-layout-content">

  <div class="container-fluid p-t-15">
    <div class="row">
      <div class="col-md-6" style="margin: auto;">
        <div class="card">
          <div class="card-header">
            <div class="card-title">云端绑定</div>
          </div>
          <div class="card-body">
            <div class="form-group">
              <label for="exampleFormControlInput1">请输入云账号</label>
              <input type="test" class="form-control" name="user" id="user" placeholder="请输入邮箱地址">
            </div>
            <div class="form-group">
              <label for="exampleFormControlInput1">请输入云密码</label>
              <input type="password" class="form-control" name="password" id="password" placeholder="请输入邮箱地址">
            </div>
            <p><a href="">没有账号？</a></p>
            <button type="button" onclick="login()" class="btn btn-outline-info btn-block">登录绑定</button>
          </div>
        </div>
      </div>
    </div>
    <div class="col-md-6" style="margin: auto;">
      <div class="alert alert-dark" role="alert">
        输入的不是本地系统的账号而是云端账号，请到云端进行注册后方可到此页面登录
        <p>地址：http://yiyanyun.top</p>
      </div>
    </div>
  </div>
</main>
{include file='public/footer'/}

<script>
  function login() {
    user = $("#user").val();
    password = $("#password").val();
    $.post("{:url('login')}", { user: user, password: password }, function (res) {
      if (res.code == 200) {
        showNotify(res.msg, 'success');
        setTimeout("location.href='/admin/index'", 3000);
      } else {
        showNotify(res.msg, 'danger');
      }
    }, 'json')
  }
</script>